html {
    box-sizing: border-box;
    --theme-color: var(--sl-color-primary-600);
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    font-family: var(--sl-font-sans);
    font-size: var(--sl-font-size-medium);
    font-weight: var(--sl-font-weight-normal);
    letter-spacing: var(--sl-letter-spacing-normal);
    background-color: var(--sl-color-neutral-0);
    color: var(--sl-color-neutral-800);
    line-height: var(--sl-line-height-normal);
}

a {
    color: var(--sl-color-primary-600);
}

    a:hover {
        color: var(--sl-color-primary-700);
    }

strong {
    font-weight: var(--sl-font-weight-bold);
}

/* Sidebar */
.sidebar {
    background-color: var(--sl-color-neutral-0);
    border-right: solid 1px var(--sl-color-neutral-200);
}

    .sidebar .app-name {
        padding: 0 1.5rem;
    }

.sidebar-version {
    font-size: var(--sl-font-size-x-small);
    font-weight: var(--sl-font-weight-normal);
    color: var(--sl-color-neutral-500);
    text-align: right;
    padding: 0 var(--sl-spacing-small);
    margin: -1.25rem 0 0.6rem 0;
}

.sidebar-buttons {
    text-align: center;
    margin-top: 0;
}

/* Sidebar toggle */
.sidebar-toggle {
    top: 0.25rem;
    left: 0.25rem;
    width: 2rem;
    height: 2rem;
    border-radius: var(--sl-border-radius-medium);
    background-color: var(--sl-color-neutral-0);
    padding: 0.5rem;
}

    .sidebar-toggle:hover .sidebar-toggle-button {
        opacity: 1;
    }

    .sidebar-toggle:active .sidebar-toggle-button span {
        background-color: var(--sl-color-primary-600);
    }

    .sidebar-toggle span:last-child {
        margin-bottom: 0;
    }

@media screen and (max-width: 768px) {
    body.close .sidebar-toggle {
        width: 2rem;
        background: none;
        padding: 0.5rem;
    }
}

/* Sidebar nav */
.sidebar ul, .sidebar ul li {
    list-style: none;
}

    .sidebar ul li a {
        overflow: hidden;
        font-weight: 400;
        text-decoration: none;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.sidebar li {
    margin: 6px 0;
}

.sidebar-nav li {
    margin: 6px 0;
}

.sidebar-nav a {
    color: inherit;
    text-decoration: none;
    line-height: 1.5em;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
}

.sidebar-nav li.collapse > a,
.sidebar-nav li.active > a,
.sidebar ul li p.active > a {
    color: var(--sl-color-primary-600);
    border-right: 2px solid;
}

.sidebar ul li ul {
    padding: 0;
}

.sidebar ul ul ul {
    padding: 0;
    margin: 0 0 0 0.5rem;
}

    .sidebar ul ul ul li {
        margin-left: 0.5rem;
    }

/* Splash */
.splash {
    display: flex;
    padding-top: 2rem;
}

.splash-start {
    min-width: 420px;
}

.splash-end {
    display: flex;
    align-items: flex-end;
    width: auto;
    padding-left: 1rem;
}

.splash-image {
    width: 100%;
    height: auto;
}

.splash-logo {
    max-width: 22rem;
}

.markdown-section .splash-start h1:first-of-type {
    font-size: var(--sl-font-size-large);
    margin: 0 0 0.5rem 0;
}

@media screen and (max-width: 1040px) {
    .splash {
        display: block;
    }

    .splash-start {
        min-width: 0;
        padding-bottom: 1rem;
    }

    .splash-end {
        padding: 0;
    }

    .splash-image {
        display: block;
        max-width: 400px;
    }

    /* Shields */
    .splash + p {
        margin-top: 2rem;
    }
}

/* Content */
.anchor span {
    color: var(--sl-color-neutral-800);
}

/* Repo buttons */
.repo-button--sponsor sl-icon {
    color: var(--sl-color-pink-600);
}

.repo-button--github sl-icon {
    color: var(--sl-color-neutral-700);
}

.repo-button--twitter sl-icon {
    color: var(--sl-color-sky-500);
}

@media screen and (max-width: 400px) {
    :not(.sidebar-buttons) > .repo-button {
        width: 100%;
        margin-bottom: 1rem;
    }
}

body[data-page^='/tokens/'] .table-wrapper td:first-child,
body[data-page^='/tokens/'] .table-wrapper td:first-child code {
    white-space: nowrap;
}

/* Border radius demo */
.border-radius-demo {
    width: 3rem;
    height: 3rem;
    background: var(--sl-color-primary-600);
}

/* Transition demo */
.transition-demo {
    position: relative;
    background: var(--sl-color-neutral-200);
    width: 8rem;
    height: 2rem;
}

    .transition-demo:after {
        content: '';
        position: absolute;
        background-color: var(--sl-color-primary-600);
        top: 0;
        left: 0;
        width: 0;
        height: 100%;
        transition-duration: inherit;
        transition-property: width;
    }

    .transition-demo:hover:after {
        width: 100%;
    }

/* Spacing demo */
.spacing-demo {
    width: 100px;
    background: var(--sl-color-primary-600);
}

/* Elevation demo */
.elevation-demo {
    background: transparent;
    border-radius: 3px;
    width: 4rem;
    height: 4rem;
    margin: 1rem;
}

/* Color palettes */
.color-palette {
    display: grid;
    grid-template-columns: 200px repeat(11, 1fr);
    gap: 1rem var(--sl-spacing-2x-small);
    margin: 2rem 0;
}

.color-palette__name {
    font-size: var(--sl-font-size-medium);
    font-weight: var(--sl-font-weight-semibold);
    grid-template-columns: repeat(11, 1fr);
}

    .color-palette__name code {
        background: none;
        font-size: var(--sl-font-size-x-small);
    }

.color-palette__example {
    font-size: var(--sl-font-size-x-small);
    text-align: center;
}

.color-palette__swatch {
    height: 3rem;
    border-radius: var(--sl-border-radius-small);
}

.color-palette__swatch--border {
    box-shadow: inset 0 0 0 1px var(--sl-color-neutral-300);
}

@media screen and (max-width: 1200px) {
    .color-palette {
        grid-template-columns: repeat(6, 1fr);
    }

    .color-palette__name {
        grid-column-start: span 6;
    }
}

.not-found-image {
    display: block;
    max-width: 460px;
    margin: 2rem 0;
}

/* toc */
.toc {
    display: none;
    position: fixed;
    right: 2em;
    bottom: 10vh;
    max-width: 20em;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1em;
    background-color: var(--sl-color-neutral-0);
    border: 1px solid var(--sl-panel-border-color);
}

@media screen and (min-width: 1361px) {
    .toc {
        display: block;
    }
}
